home *** CD-ROM | disk | FTP | other *** search
/ Freelog 115 / FreelogNo115-MaiJuin2013.iso / Internet / Filezilla Server / FileZilla_Server-0_9_41.exe / source / Server.h < prev    next >
C/C++ Source or Header  |  2011-11-06  |  2KB  |  74 lines

  1. // Server.h: Schnittstelle fⁿr die Klasse CServer.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4.  
  5. #if !defined(AFX_SERVER_H__4896D8C6_EDB5_438E_98E6_08957DBCD1BC__INCLUDED_)
  6. #define AFX_SERVER_H__4896D8C6_EDB5_438E_98E6_08957DBCD1BC__INCLUDED_
  7.  
  8. #if _MSC_VER > 1000
  9. #pragma once
  10. #endif // _MSC_VER > 1000
  11.  
  12. class CListenSocket;
  13. class CServerThread;
  14. class COptions;
  15. class CAdminListenSocket;
  16. class CAdminInterface;
  17. class CAdminSocket;
  18. class CFileLogger;
  19. class CAutoBanManager;
  20.  
  21. class CServer  
  22. {
  23. public:
  24.     void ShowStatus(LPCTSTR msg, int nType);
  25.     void ShowStatus(DWORD eventDateHigh, DWORD eventDateLow, LPCTSTR msg, int nType);
  26.     BOOL ProcessCommand(CAdminSocket *pAdminSocket, int nID, unsigned char *pData, int nDataLength);
  27.     virtual void OnClose();
  28.     bool Create();
  29.     CServer();
  30.     virtual ~CServer();
  31.     HWND GetHwnd();
  32.     COptions *m_pOptions;
  33.     CAutoBanManager* m_pAutoBanManager;
  34. protected:
  35.     BOOL CreateListenSocket();
  36.     BOOL CreateAdminListenSocket();
  37.     int DoCreateAdminListenSocket(UINT port, LPCTSTR addr, int family);
  38.     void OnTimer(UINT nIDEvent);
  39.     BOOL ToggleActive(int nServerState);
  40.     unsigned int GetNextThreadNotificationID();
  41.     void FreeThreadNotificationID(CServerThread *pThread);
  42.     
  43.     // Send state to interface
  44.     void SendState();
  45.     
  46.     BOOL m_bQuit;
  47.     int m_nServerState;
  48.     CAdminInterface *m_pAdminInterface;
  49.     CFileLogger *m_pFileLogger;
  50.     
  51.     std::list<CServerThread*> m_ThreadArray;
  52.     std::list<CServerThread*> m_ClosedThreads;
  53.  
  54.     std::vector<CServerThread*> m_ThreadNotificationIDs;
  55.     std::list<CAdminListenSocket*> m_AdminListenSocketList;
  56.     std::list<CListenSocket*> m_ListenSocketList;
  57.  
  58.     std::map<int, t_connectiondata> m_UsersList;
  59.  
  60.     UINT m_nTimerID;
  61.     
  62.     _int64 m_nRecvCount;
  63.     _int64 m_nSendCount;
  64.     
  65.     UINT m_nBanTimerID;
  66.  
  67.     LRESULT OnServerMessage(CServerThread *pThread, WPARAM wParam, LPARAM lParam);
  68. private:
  69.     static LRESULT CALLBACK WindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
  70.     HWND m_hWnd;
  71. };
  72.  
  73. #endif // !defined(AFX_SERVER_H__4896D8C6_EDB5_438E_98E6_08957DBCD1BC__INCLUDED_)
  74.